Notebook

Notebook is a view that can hold only children of type Element. With this restriction, there is no limitation in number of children it can hold.

class Aduct.Views.Notebook.Notebook(**kwargs)

Makes a notebook based on given properties. Its CSS name is aduct-notebook.

Parameters:
  • **kwargs – The values to be passed to Gtk.Notebook from which Notebook is made.
  • Signals
    action-clicked
    Emitted with an integer when action button of self is clicked. The integer is 1, 2, 3 for LMB, MMB, RMB respectively.
add_child(child, position=-1)

Adds the child self.

Parameters:child (Element) – The child to be added to self.
Raises:TypeError – Raised when child is not a Element.
change_child_label(child)

Changes the tab label for existing child.

The text for new label is taken as the name of child of child (Aduct.Element.child_name). It is set to No child when child has no name for its child (Aduct.Element.child_name is None).

Parameters:child (Element) – The child whose tab label has to be changed.
get_action_button(pack_type)

Gets the action button at given position.

Parameters:pack_type (Gtk.PackType) – The position from which action button has to retrieved.
Returns:The action button of self or None if self has no action button.
Return type:Gtk.Button or None
get_number_of_action_buttons()

Gets the number of action buttons present.

Returns:The number of action buttons.
Return type:int
get_props()

Gets the interface properties.

Returns:A dictionary with interface properties.
Return type:dict
get_tab(child)

Gets a tab label for child.

The text for new label is taken as the name of child of child (Aduct.Element.child_name). It is set to No child when child has no name for its child (Aduct.Element.child_name is None). Based on position of tabs in self, the orientation of text in the label also varies.

Parameters:child (Element) – The child which requires a tab label.
Returns:Label with text determined from child.
Return type:Gtk.Label
remove_child(child)

Removes the given child from self.

Parameters:child (Element) – The child which has to be removed from self.
Raises:ValueError – Raised when child is not present in self.
replace_child(old_child, new_child)

Replaces the existing child with a new child.

Parameters:
  • old_child (Element) – The child present in self which has to be replaced.
  • new_child (Element) – The child that will replace the given existing child of self.
Raises:

TypeError – Raised when new_child is not a Element.

set_action_button(action_button, pack_type)

Sets the action button to notebook.

Parameters:
  • action_button (Gtk.Button) – The button to be added to notebook. It need not be a Gtk.Button actually, it could be any widget that can handle button-press-event.
  • pack_type (Gtk.PackType) – The position of the action button.
set_from_props(props)

Sets the interface from given properties.

Parameters:props (dict) – The dictionary containig properties of interface.
Raises:ValueError – Raised when there is a mismatch of number of action buttons in properties and self.
type

Used by autodoc_mock_imports.